import { FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: '菜单名称',
    colProps: {
      md: 6,
      sm: 8,
    },
  },
];

export const menuColumns: BasicColumn[] = [
  {
    title: '角色名称',
    align: 'center',
    dataIndex: 'name',
  },
  {
    title: '菜单类型',
    align: 'center',
    dataIndex: 'parentId',
  },
  {
    title: '描述',
    align: 'center',
    dataIndex: 'description',
  },
  {
    title: 'Icon',
    align: 'center',
    dataIndex: 'icon',
  },
  {
    title: '排序',
    dataIndex: 'sort',
    align: 'center',
    sorter: true,
  },
];

export const menuFormSchemas: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: '菜单名称',
    required: true,
  },
  {
    field: 'parentId',
    component: 'TreeSelect',
    label: '上级菜单',
    required: true,
    componentProps: {
      disabled: true,
    },
  },
  {
    field: 'description',
    component: 'InputTextArea',
    label: '描述',
  },
  {
    field: 'icon',
    component: 'IconPicker',
    label: '菜单图标',
  },
  {
    field: 'sort',
    component: 'InputNumber',
    label: '排序',
  },
];
